package com.wxd.controller;

import com.wxd.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author wxd
 * @version V1.0
 * @description UserController
 * @date 2022/10/11 14:40
 **/
@RequestMapping("/user")
@RestController
@Slf4j
public class UserController {
    @RequestMapping("/save")
    public String save(@RequestBody User user) {
        log.info(user.toString());
        return "success";
    }

    @RequestMapping("/get")
    public User get() {
        User user = new User();
        user.setId("1");
        user.setName("张三");
        user.setAge(25);
        user.setRegisterDate(new Date());
        return user;
    }
}
